package csel.controller.commands;

import csel.model.Entity;
import csel.model.GameFactory;
import csel.model.Model;
import csel.model.GameCommand;
import csel.model.Occupation;
import csel.view.NewGameDialog;
import csel.view.StatusViewport;
import csel.view.Viewport;

public class NewCommand implements GameCommand
{
	private Model model;
	private Viewport viewport;
	private Occupation occupation;
	private String name;
	
	//constructs new New command
	public NewCommand(Model model, Viewport viewport)
	{
		this.model = model;
		this.viewport = viewport;
		NewGameDialog newGameDialog = new NewGameDialog();
		newGameDialog.show();
		this.occupation = newGameDialog.getOccupation();
		this.name = newGameDialog.getName();
		System.out.println("[GAMECOMMAND] "+ name);
		System.out.println("[GAMECOMMAND] "+ occupation.getClass());
	}
	
	//
	public void execute()
	{
		GameFactory.newGame(occupation, name, model);
		System.out.println("[MODEL] the New command has been called");
	}

}